/*
 * @Author: xuman
 * @Date: 2020-05-25 11:19:11
 * @LastEditors: xuman
 * @LastEditTime: 2020-06-28 11:14:54
 */

import request from '@/utils/request'
const baseURL =
  process.env.NODE_ENV === 'production' ? '/api/riskModel' : '/riskModel'

// 列表list
export const getModelList = (data: any) =>
  request({
    baseURL,
    url: '/api/model/page',
    method: 'post',
    data
  })

// 删除模型
export const deleteModel = (data: { modelCode: string }) =>
  request({
    baseURL,
    url: '/api/model/delete',
    method: 'post',
    data
  })

// 模型导入
export const addModel = (data: any) =>
  request({
    baseURL,
    url: '/api/model/upload',
    method: 'post',
    data
  })

// 模型API导入
export const addApiModel = (data: any) =>
  request({
    baseURL,
    url: '/api/model/add',
    method: 'post',
    data
  })

// 查询模型入参
export const getModelInParam = (data: any) =>
  request({
    baseURL,
    url: '/api/model/inputSchema/page',
    method: 'post',
    data
  })

// 查询模型出参
export const getModelOutParam = (data: any) =>
  request({
    baseURL,
    url: '/api/model/outputSchema/list',
    method: 'post',
    data
  })

// 调试模型
export const debugModel = (data: any) =>
  request({
    baseURL,
    url: '/api/model/debug',
    method: 'post',
    data
  })
// 保存模型映射
export const submitModelMap = (data: any) =>
  request({
    baseURL,
    url: '/api/model/inputSchema/save',
    method: 'post',
    data
  })
